import 'package:hotpot/generated/json/base/json_field.dart';
import 'package:hotpot/generated/json/shop_detail.g.dart';
import 'dart:convert';

import 'package:hotpot/models/floor.dart';

@JsonSerializable()
class ShopDetail {

	@JSONField(name: "pos_session")
	ShopDetailPosSession? posSession;
	Map<String, dynamic>? attributes;
	@JSONField(name: "module_pos_hr")
	bool? modulePosHr;
	@JSONField(name: "hr_employees")
	List<ShopDetailHrEmployees>? hrEmployees;
	@JSONField(name: "vegetable_sequences")
	List<ShopDetailVegetableSequences>? vegetableSequences;
	@JSONField(name: "restaurant_floors")
	List<Floor>? restaurantFloors;
	@JSONField(name: "pos_categorys")
	List<ShopDetailPosCategorys>? posCategorys;
	@JSONField(name: "product_products")
	List<ShopDetailProductProducts>? productProducts;
	@JSONField(name: "pos_combo")
	List<PosCombo>? posCombo;
	@JSONField(name: "pos_combo_line")
	List<PosComboLine>? posComboLine;
	@JSONField(name: "home_images")
	List<String>? homeImages;
  
  ShopDetail();

  factory ShopDetail.fromJson(Map<String, dynamic> json) => $ShopDetailFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailPosSession {

	int? id;
	String? name;
	@JSONField(name: "user_id")
	List<int>? userId;
	@JSONField(name: "config_id")
	List<String>? configId;
	@JSONField(name: "start_at")
	String? startAt;
	@JSONField(name: "stop_at")
	bool? stopAt;
	@JSONField(name: "sequence_number")
	int? sequenceNumber;
	@JSONField(name: "payment_method_ids")
	List<int>? paymentMethodIds;
	String? state;
	@JSONField(name: "update_stock_at_closing")
	bool? updateStockAtClosing;
	@JSONField(name: "cash_register_balance_start")
	int? cashRegisterBalanceStart;
	@JSONField(name: "access_token")
	String? accessToken;
	@JSONField(name: "login_number")
	int? loginNumber;
  
  ShopDetailPosSession();

  factory ShopDetailPosSession.fromJson(Map<String, dynamic> json) => $ShopDetailPosSessionFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailPosSessionToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailAttributes {

	int? id;
	String? name;
	@JSONField(name: "display_type")
	String? displayType;
	List<ShopDetailAttributesValues>? values;
	int? sequence;
	@JSONField(name: "can_be_set_qty")
	bool? canBeSetQty;
	@JSONField(name: "max_qty")
	int? maxQty;
  
  ShopDetailAttributes();

  factory ShopDetailAttributes.fromJson(Map<String, dynamic> json) => $ShopDetailAttributesFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailAttributesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailAttributesValues {

	int? id;
	String? name;
	@JSONField(name: "is_custom")
	bool? isCustom;
	@JSONField(name: "html_color")
	String? htmlColor;
	String? image;
	@JSONField(name: "max_qty")
	int? maxQty;
	@JSONField(name: "price_extra")
	double? priceExtra;
  
  ShopDetailAttributesValues();

  factory ShopDetailAttributesValues.fromJson(Map<String, dynamic> json) => $ShopDetailAttributesValuesFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailAttributesValuesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailHrEmployees {

	int? id;
	String? name;
	@JSONField(name: "user_id")
	int? userId;
	@JSONField(name: "work_contact_id")
	int? workContactId;
	String? role;
	bool? barcode;
	String? pin;
  
  ShopDetailHrEmployees();

  factory ShopDetailHrEmployees.fromJson(Map<String, dynamic> json) => $ShopDetailHrEmployeesFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailHrEmployeesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailVegetableSequences {

	int? id;
	String? name;
	int? sequence;
	int? color;
  
  ShopDetailVegetableSequences();

  factory ShopDetailVegetableSequences.fromJson(Map<String, dynamic> json) => $ShopDetailVegetableSequencesFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailVegetableSequencesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailPosCategorys {

	int? id;
	String? name;
	@JSONField(name: "parent_id")
	List<String>? parentId;
	@JSONField(name: "child_id")
	List<int>? childId;
	@JSONField(name: "write_date")
	String? writeDate;
	@JSONField(name: "has_image")
	bool? hasImage;
	int? color;
	bool? required;
  
  ShopDetailPosCategorys();

  factory ShopDetailPosCategorys.fromJson(Map<String, dynamic> json) => $ShopDetailPosCategorysFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailPosCategorysToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopDetailProductProducts {

	int? id;
	String? name;
	bool? barcode;
	@JSONField(name: "cn_name")
	String? cnName;
	@JSONField(name: "default_code")
	String? defaultCode;
	@JSONField(name: "public_description_image")
	String? publicDescriptionImage;
	@JSONField(name: "public_description_text")
	String? publicDescriptionText;
	@JSONField(name: "allergy_source")
	List<String>? allergySource;
	@JSONField(name: "product_tag")
	String? productTag;
	@JSONField(name: "lst_price")
	double? lstPrice;
	@JSONField(name: "need_vegetable_sequence")
	bool? needVegetableSequence;
	@JSONField(name: "can_set_attributes_qty")
	bool? canSetAttributesQty;
	@JSONField(name: "attribute_line_ids")
	List<int>? attributeLineIds;
	@JSONField(name: "pos_categ_ids")
	List<int>? posCategIds;
	@JSONField(name: "combo_ids")
	List<int>? comboIds;
	List<String>? notes;
	String? image;
	List<String>? images;
  
  ShopDetailProductProducts();

  factory ShopDetailProductProducts.fromJson(Map<String, dynamic> json) => $ShopDetailProductProductsFromJson(json);

  Map<String, dynamic> toJson() => $ShopDetailProductProductsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class PosCombo {

	int? id;
	String? name;
	@JSONField(name: "combo_line_ids")
	List<int>? comboLineIds;
	@JSONField(name: "base_price")
	int? basePrice;

	PosCombo();

	factory PosCombo.fromJson(Map<String, dynamic> json) => $PosComboFromJson(json);

	Map<String, dynamic> toJson() => $PosComboToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PosComboLine {

	int? id;
	@JSONField(name: "product_id")
	List<String>? productId;
	@JSONField(name: "combo_price")
	int? comboPrice;
	@JSONField(name: "combo_id")
	List<String>? comboId;

	PosComboLine();

	factory PosComboLine.fromJson(Map<String, dynamic> json) => $PosComboLineFromJson(json);

	Map<String, dynamic> toJson() => $PosComboLineToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}